package day27;

import java.io.*;
import java.net.Socket;

public class Client1 {
    public static void main(String[] args) throws IOException {
        //1.创建客户端对象
        Socket client = new Socket("192.168.9.158",9999);
        //2.创建输出流
        BufferedReader br = new BufferedReader(new InputStreamReader(client.getInputStream()));
        OutputStream oos = client.getOutputStream();
        System.out.println("服务端:"+br.readLine());
        oos.write("你好，我是客户端\n".getBytes());
    }
}
